
#pragma once

#include <Singleton.h>
#include "threadSync_t.h"
#include "kernelImpl_t.h"
#include "kernelMutex_t.h"

class kernelMgr_t : public Singleton<kernelMgr_t>
{
	friend class Singleton<kernelMgr_t>;
protected:
	kernelMgr_t(){};
	~kernelMgr_t(){};

public:
	void addKernel(kernelImpl_t* kernel);
	void delKernel(kernelImpl_t* kernel);

	vector<kernelImpl_t*> getKernels(){ 
		KER_MUTEX 
			return kernels; };
	kernelImpl_t* getObjKernel( const UniqueID & obj );

private:
	vector<kernelImpl_t*> kernels;
	//Mutex m;
};

#define kerMgr kernelMgr_t::GetSingleton()